//
//  classifyTableViewCell.m
//  LazyCat
//
//  Created by rocky on 15/12/28.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "classifyTableViewCell.h"

@implementation classifyTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.nameL = [[UILabel alloc]init];
        [self addSubview:self.nameL];
        self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.editBtn];
        self.delateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.delateBtn];
        self.lineV = [[UIView alloc]init];
        [self addSubview:self.lineV];
        self.replaceBtn1 = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.replaceBtn1];
        self.replaceBtn2 = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.replaceBtn2];
        self.duiIV = [[UIImageView alloc]init];
        [self addSubview:self.duiIV];
    }
    return self;
}
-(void)layoutSubviews {
    self.nameL.frame = CGRectMake(15, 0, ScreenWidth-100, 40);
    self.nameL.font = [UIFont systemFontOfSize:14];
    self.nameL.textAlignment = NSTextAlignmentLeft;
    self.nameL.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0];
    
    self.editBtn.frame = CGRectMake(ScreenWidth-60, 13, 15, 15);
    self.editBtn.tag = 100;
    [self.editBtn setBackgroundImage:[UIImage imageNamed:@"editClassify"] forState:UIControlStateNormal];
    [self.editBtn addTarget:self action:@selector(editAndDela:) forControlEvents:UIControlEventTouchUpInside];
    
    self.replaceBtn1.frame = CGRectMake(ScreenWidth-70, 5, 35, 30);
    self.replaceBtn1.tag = 300;
    [self.replaceBtn1 addTarget:self action:@selector(editAndDela:) forControlEvents:UIControlEventTouchUpInside];
    
    self.delateBtn.frame = CGRectMake(ScreenWidth-30, 13, 15, 15);
    self.delateBtn.tag = 200;
    [self.delateBtn setBackgroundImage:[UIImage imageNamed:@"delateClassify"] forState:UIControlStateNormal];
    [self.delateBtn addTarget:self action:@selector(editAndDela:) forControlEvents:UIControlEventTouchUpInside];
    
    self.replaceBtn2.frame = CGRectMake(ScreenWidth-30, 5, 30, 30);
    self.replaceBtn2.tag = 400;
    [self.replaceBtn2 addTarget:self action:@selector(editAndDela:) forControlEvents:UIControlEventTouchUpInside];
    
    self.lineV.backgroundColor = [UIColor lightGrayColor];
    self.lineV.alpha = 0.2;
    
    self.duiIV.frame = CGRectMake(ScreenWidth-35, 14, 24, 16);
    self.duiIV.image = [UIImage imageNamed:@"chanpin_cur"];
}
-(void)editAndDela:(UIButton *)sender {
    [_delegate tableViewCell:self btn:sender];
}
- (void)awakeFromNib {
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
